
const mockData = {
  'saleMake': {
    id: '@id',
    'planStatus|1': ['待发送', '已发送', '未提交', '已提交', '门店审核通过', '门店驳回'],
    makingMonth: '2020-11',
    ttCode: 'af0A666666666FG01VB01B',
    planMonth: '2020-3',
    planWeek: 'w1',
    planNum: '22',
    carSeriesCode: 'A1',
    carSeriesCn: '岚图111',
    carConfigCode: 'af0A666666666',
    carConfigCn: '紧凑型车',
    optionalPagCode: 'FG01V',
    optionalPagName: '氙气包',
    carColorCode: 'B01',
    carColorName: '中国红',
    carIncolorCode: 'B',
    carIncolorName: '黑色',
    creator: '小明',
    createdDate: '2020-01-23',
    sendTime: '2020-01-23',
    priorityLevel: '高',
    planSource: '岚图'
    // 'infoCode|5-10': [
    //   {
    //     'salesPlanCode|1': ['ahdf', 'sadkfj', 'fjdas', 'fadsj', 'fsdjk'],
    //     'VINCode|1': ['AAAA', 'BBBB', 'CCCC', 'DDDD']
    //   }
    // ]
  },
  provinceList: {
    'provinceId|+1': ['1', '2'],
    'provinceName|+1': ['湖北', '湖南']
  },
  cityList1: {
    'cityId|+1': ['C0001', 'C0002'],
    'cityName|+1': ['北京', '上海']
  },
  cityList2: {
    'cityId|+1': ['C0003', 'C0004'],
    'cityName|+1': ['武汉', '深圳']
  },
  deliveryList1: {
    'deliveryId|+1': ['DE001', 'DE002', 'DE003'],
    'deliverText|+1': ['朝阳XX交付中心', '丰台XX交付中心', '石景山XX交付中心']
  },
  deliveryList2: {
    'deliveryId|+1': ['DE004', 'DE005', 'DE006'],
    'deliverText|+1': ['黄浦XX交付中心', '徐汇XX交付中心', ' 静安XX交付中心']
  },
  statics: {
    'name|+1': ['车系A', '车系B', '颜色A', '颜色B', '颜色C', '车型配置A', '车型配置B'],
    number: '@integer(10,120)'
  },
  vehicleSelect: {
    'carSeriesId|+1': ['A1' , 'A2'],
    'carSeriesCn|+1': ['岚图A', '岚图B']
  },
}
// 生成从minNum到maxNum的随机数
function randomNum(minNum, maxNum) {
  switch (arguments.length) {
    case 1:
      return parseInt(Math.random() * minNum + 1, 10)
    case 2:
      return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10)
    default:
      return 0
  }
}


export default [
  // /mp/e3sh/planreport/ve/StoreMonthSalePlanReportService/selectCarSeriesList.do
  // /mp/e3sh/planreport/ve/StoreMonthSalePlanReportService/selectCarConfigBySeriesId.do
  // /mp/e3sh/planreport/ve/storeSalePlanDateSetService/queryCarSeriesName.do
  {
    // 车系名称查询
    url: '/mp/e3sh/planreport/ve/storeSalePlanDateSetService/queryCarSeriesName.do',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(10).fill({
          carSeriesCode: 'snfd',
          carSeriesCn: '蓝图',
          carSeriesEn: 'lanTu',
          orderNo: '23'
        })
      }
    }
  },
  {
    // 车系查询
    url: '/mp/e3sh/planreport/ve/StoreMonthSalePlanReportService/selectCarSeriesList.do',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(2).fill(mockData.vehicleSelect)
      }
    }
  },
  {
    // 车型查询
    url: '/mp/e3sh/planreport/ve/StoreMonthSalePlanReportService/selectCarConfigBySeriesId.do',
    type: 'post',
    data: {},
    response: config => {
      const { carSeriesId } = config.body
      let rows
      switch (carSeriesId) {
        case 'A1':
          rows = Array(2).fill({
            'carConfigCode|+1': ['abcde12345678', 'abcde12335678'],
            'carConfigName|+1': ['舒适型', '运动型'],
          })
          break
        case 'A2':
          rows = Array(2).fill({
            'carConfigCode|+1': ['abcde12341678', 'abcde12365678'],
            'carConfigName|+1': ['豪华型', '土豪型'],
          })
          break
        case '':
          rows = []
          break
      }
      return {
        'result': '1',
        'msg': 'Success',
        'rows': rows
      }
    }
  },

  {
    // 总部计划制定
    url: '/statics',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(randomNum(3, 7)).fill(mockData.statics)
      }
    }
  },
  {
    // 总部计划制定
    url: '/planreport/headquartersalemake',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 门店计划制定
    url: '/planreport/storessalemake',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 门店计划审核
    url: '/planreport/storessaleaudit',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 总店查看门店计划
    url: '/planreport/headquartersviewstore',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 未提交计划门店明细
    url: '/planreport/notsubmitstores',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 总部周计划确认
    url: '/planreport/confirmWeekSalesPlan',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 计划跟踪
    url: '/planreport/planTracking',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 已发送的插单信息查询
    url: '/planreport/sendsuccessorderquery',
    type: 'post',
    data: {},
    response: config => {
      const { pageSize } = config.body
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(pageSize).fill(mockData.saleMake)
      }
    }
  },
  {
    // 省查询
    url: '/org/province',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(2).fill(mockData.provinceList)
      }
    }
  },
  {
    // 市查询
    url: '/org/city',
    type: 'post',
    data: {},
    response: config => {
      const { lookupTypeCode } = config.body
      let rows = []
      console.log(lookupTypeCode)
      switch (lookupTypeCode) {
        case 'P0001':
          rows = Array(2).fill(mockData.cityList1)
          break
        case 'P0002':
          rows = Array(2).fill(mockData.cityList2)
          break
        case 'C0001':
          rows = Array(3).fill(mockData.deliveryList1)
          break
        case 'C0002':
          rows = Array(3).fill(mockData.deliveryList2)
          break
      }
      return {
        'result': '1',
        'msg': 'Success',
        'rows': rows
      }
    }
  }
]
